package com.zhenyi;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
/**
 * @author ：zhenyi
 * @date ：2020/9/6 14:16
 * @description：${description}
 */
public class BeanFactoryTest {
	public static void main(String[] args) throws IOException {
		XmlBeanFactory xmlBeanFactory = new XmlBeanFactory(new ClassPathResource("application.xml"));
		System.out.println("BeanFactory中Bean的数量："+xmlBeanFactory.getBeanDefinitionCount());
		String[] bdNames = xmlBeanFactory.getBeanDefinitionNames();
		for(String str: bdNames)
			System.out.println("bean的名字："+str);
//		MyTestBean bean = (MyTestBean)xmlBeanFactory.getBean("hello");
//		System.out.println(bean.getTeststr());
	}
}
